
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 2
 * @Author : WangRuoyu 
 * @Date : 2023/5/11 9:10
 */

#include "iostream"
#include "cstring"
#include "algorithm"

using namespace std;

int const N = 110;
int s[N][N] = {0};

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        for (int j = x1; j < x2; ++j) {
            for (int k = y1; k < y2; ++k) {
                s[j][k]++;
            }
        }
    }
    int res = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < N; ++j) {
            if (s[i][j]) res++;
        }
    }
    cout << res;
    return 0;
}
